import { request } from "@/utils/service"
import type * as Job from "./types/job"
import { getToken } from "@/utils/cache/cookies"

/** 增 */
export function createJobDataApi(data: Job.ICreateJobRequestData) {
  return request({
    url: "job/add",
    method: "post",
    data
  })
}

/** 删 */
export function deleteJobDataApi(id: string) {
  return request({
    url: "job/del",
    method: "delete",
    params: {
      id
    }
  })
}

/** 改 */
export function updateJobDataApi(data: Job.IUpdateJobRequestData) {
  return request({
    url: "job/update",
    method: "put",
    data
  })
}

/** 查 */
export function getJobDataApi(params: Job.IGetJobRequestData) {
  return request({
    url: "job/query",
    method: "get",
    params
  })
}
/**图片上传 */
export function uploadJobImageList(data: any) {
  return request({
    url: "job/upload",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}
